/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化，请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using VOL.Entity.SystemModels;

namespace VOL.Entity.DomainModels
{
    [SugarTable("purchaseordermodel", TableDescription = "进货单主表")]
    [Entity(TableCnName = "进货单主表", TableName = "purchaseordermodel")]
    public partial class PurchaseOrderModel : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [Key]
        [Display(Name = "主键")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long Id { get; set; }

        /// <summary>
        /// 进货单号(自动获取系统编号)
        /// </summary>
        [Display(Name = "进货单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string OrderCode { get; set; }

        /// <summary>
        /// 进货日期
        /// </summary>
        [Display(Name = "进货日期")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? OrderDate { get; set; }

        /// <summary>
        /// 供应商 ID
        /// </summary>
        [Display(Name = "供应商ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? SupplierId { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [Display(Name = "联系人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string Contact { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [Display(Name = "联系方式")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string ContactPhone { get; set; }

        /// <summary>
        /// 进货部门 ID
        /// </summary>
        [Display(Name = "进货部门ID")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string DeptId { get; set; }

        /// <summary>
        /// 进货人 ID
        /// </summary>
        [Display(Name = "进货人ID")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? UserId { get; set; }

        /// <summary>
        /// 单据状态(1.草稿、2.待审批....)
        /// </summary>
        [Display(Name = "单据状态")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? Status { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        [Display(Name = "审核人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string AuditUser { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        [Display(Name = "审核时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string Remarks { get; set; }

        /// <summary>
        /// 删除标识
        /// </summary>
        [Display(Name = "删除标识")]
        [Column(TypeName = "tinyint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public sbyte IsDel { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? ModifyDate { get; set; }

        /// <summary>
        /// 创建人id
        /// </summary>
        [Display(Name = "创建人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? CreateID { get; set; }

        /// <summary>
        /// 修改人id
        /// </summary>
        [Display(Name = "修改人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? ModifyID { get; set; }

        /// <summary>
        /// 货品数量（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "货品数量")]
        public int? TotalQuantity { get; set; }

        /// <summary>
        /// 货品金额（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "货品金额")]
        public decimal? TotalAmount { get; set; }

        /// <summary>
        /// 进货货品（从明细表汇总）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "进货货品")]
        public string PurchaseGoods { get; set; }

        /// <summary>
        /// 供应商名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "供应商名称")]
        public string SupplierName { get; set; }

        /// <summary>
        /// 进货人姓名（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "进货人姓名")]
        public string UserName { get; set; }

        /// <summary>
        /// 进货部门名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "进货部门名称")]
        public string DeptName { get; set; }

        /// <summary>
        /// 单据状态名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "单据状态名称")]
        public string StatusName { get; set; }
    }
}
